package com.mrjy.queries.controller;

import com.mrjy.common.entity.CustomModule;
import com.mrjy.custom.dto.CustomModuleDto;
import com.mrjy.queries.bo.IQuestionTopicInfoBo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/queries/topicInfo")
public class QuestionTopicInfoController {
	
	@Resource
	private IQuestionTopicInfoBo questionTopicInfoBo;
	
	/**
	 * 查询话题信息列表
	 * @return
	 * @author Javin : isUer = ture
	 */
	@RequestMapping("/queryListTopicInfo")
	@ResponseBody
	public Object queryListTopicInfo(){
		return questionTopicInfoBo.queryListTopicInfo();
	}
	/**
	 * 根据话题ID查询内容及统计其相关问题数量
	 * @param id
	 * @return
	 * @author Javin : isUse = true,
	 */
	@RequestMapping("/queryById")
	@ResponseBody
	public Object queryById(@RequestParam("id") Integer id){
		return questionTopicInfoBo.queryById(id);
		
	}
	/**
	 * 
	 */
	@RequestMapping("/queryListTopicInfoForEasyUI")
	@ResponseBody
	public Object queryListTopicInfoForEasyUI(){
		return questionTopicInfoBo.queryListTopicInfoForEasyUI();
	}


    /**
     * 查询自定义话题信息列表
     *
     * @return
     */
    @RequestMapping("/queryListCustomTopicInfo")
    @ResponseBody
    public Object queryListCustomTopicInfo(CustomModuleDto customModuleDto) {
        return questionTopicInfoBo.queryListCustomTopicInfo(customModuleDto);
    }

    /**
     * 查询自定义话题信息列表
     *
     * @return
     */
    @RequestMapping("/countByCustomId")
    @ResponseBody
    public Object countByCustomId(CustomModule customModule) {
        return questionTopicInfoBo.countByCustomId(customModule);
    }
    
	/**
	 * 微信1.6.8
	 * 渲染 话题页
     * 传sortType relatedCP-相关课程包  communication-交流   parent-家长 classmate-同学
     * @param module
	 * @param session
	 * @return
	 */
	@RequestMapping("/drawTopic")
	@ResponseBody
	public Object drawTopic(CustomModuleDto module,HttpSession session){
		return questionTopicInfoBo.drawTopic(module,session);
	}
}
